package com.alignet.gn.security;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import org.bouncycastle.util.encoders.Base64;

public final class Security{
	private Security(){}


public static String hashing(String cadena) throws NoSuchAlgorithmException{
              String retorno = null;
              MessageDigest md = MessageDigest.getInstance("SHA-1");
              md.update(Base64.decode(cadena));
              retorno = new String(Base64.encode(md.digest()));
        return retorno;
}

public static void main(String[] args) throws Exception {
	System.out.println(hashing("czarate123456"));
	System.out.println(hashing("gquispe12345"));
}

}